<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增公告管理')"/>
    <th:block th:include="include :: datetimepicker-css"/>
    <th:block th:include="include :: bootstrap-select-css"/>
    <th:block th:include="include :: summernote-css"/>
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-manager-add">
        <div class="form-group">
            <label class="col-sm-2 control-label">公告标题：</label>
            <div class="col-sm-10">
                <input id="title" name="title" class="form-control" type="text" required placeholder="请输入公告标题">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">有效期：</label>
            <div class="col-sm-10">
                <div class="input-daterange input-group">
                    <input type="text" class="time-input form-control" id="timeStart" name="timeStart"
                           placeholder="开始时间" readonly>
                    <span class="input-group-addon">-</span>
                    <input type="text" class="time-input form-control" id="timeEnd" name="timeEnd" placeholder="结束时间"
                           readonly>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">查看人员：</label>
            <div class="col-sm-8">
                <div id="menuTrees" class="ztree"></div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: summernote-js"/>
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">
    var prefix = ctx + "system/manager";

    $(function() {
        // var url = ctx + "system/menu/roleMenuTreeData";
        var options = {
            id: "menuTrees",
            url: prefix,
            check: { enable: true },
            expandLevel: 0
        };
        $.tree.init(options);
    });
    
    function submitHandler() {
        var val = $("#form-manager-add").serialize();
        if ($.validate.form()) {
            var fromData = $("#form-manager-add").serialize();
            $.operate.save(prefix + "/add", fromData);
        }
    }

</script>
</body>
</html>